Skip to content

storage: Fix for runtime invalid-socket-address error - #26806

Merged
rjobanp merged 2 commits into
MaterializeInc:mainfrom
rjobanp:fix-pl-invalid-socket-addr
Apr 25, 2024
Merged

storage: Fix for runtime invalid-socket-address error#26806
rjobanp merged 2 commits into
MaterializeInc:mainfrom
rjobanp:fix-pl-invalid-socket-addr

Conversation

@rjobanp

@rjobanp rjobanp commented Apr 25, 2024

Copy link
Copy Markdown
Contributor

Motivation

Postgres connections over AWS PrivateLink were broken by #26186 which introduced a runtime error because tokio::net::lookup_host here requires a port provided:

let privatelink_host = mz_cloud_resources::vpc_endpoint_name(*connection_id);
let privatelink_addrs = tokio::net::lookup_host(privatelink_host).await?;

We unfortunately did not have a PrivateLink + Postgres Source test in CI. This work is tracked here https://github.com/MaterializeInc/cloud/issues/8238 and will be prioritized for implementation during the next 2 weeks (cc @jubrad @pH14 @benesch )

I reproduced this error on my staging environment using a debug build (from #26804) and then verified this fix with a second debug build (from #26805)

This also fixes the thiserror conversion for PostgresError that caused us to originally attribute the error to something related to ssh-connections.

Tips for reviewer

Checklist

@rjobanp
rjobanp requested review from a team, benesch and guswynn April 25, 2024 16:07

@guswynn guswynn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like tokio's ToSocketAddr's has a broken api that it lets this happen!

@rjobanp
rjobanp merged commit fcda42c into MaterializeInc:main Apr 25, 2024
@rjobanp
rjobanp deleted the fix-pl-invalid-socket-addr branch April 25, 2024 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants